﻿using System.Windows.Forms;
using System;

namespace Outlook.WorkItems.Extension.Controls
{
    public partial class SelectTeamProjectForm : Form
    {
        [Obsolete("Use ServerUri", true)]
        public string ServerName
        {
            get
            {
                TeamProjectNode node = teamTreeViewUC1.treeView1.SelectedNode as TeamProjectNode;
                if (node != null)
                    return node.Favorite.TeamServerName;

                return null;
            }
        }

        public string ServerUri
        {
            get
            {
                TeamProjectNode node = teamTreeViewUC1.treeView1.SelectedNode as TeamProjectNode;
                if (node != null)
                    return node.Favorite.TeamServerUri;

                return null;
            }
        }

        public string ProjectName
        {
            get
            {
                TeamProjectNode node = teamTreeViewUC1.treeView1.SelectedNode as TeamProjectNode;
                if (node != null)
                    return node.Favorite.TeamProjectName;

                return null;
            }
        }

        public SelectTeamProjectForm()
        {
            InitializeComponent();

            teamTreeViewUC1.InitTreeView();
        }
    }
}
